#pragma once

#include "LogFile.h"
#include "Mutex.h"
#include "Singleton.h"

namespace Core
{

	enum LogLevels
	{
		LogLevel_Normal = 0,
		LogLevel_Info,
		LogLevel_Warning,
		LogLevel_Error,
		LogLevel_Critical
	};

	std::ostream& operator<<(std::ostream& p_Out, LogLevels p_LogLevel);

	class Log : public Singleton<Log>
	{
		friend class Singleton<Log>;

	private:
		Mutex m_Mutex;
		LogFileWriter m_LogFile;
		bool m_WriteToCout;
		bool m_WriteToLogFile;

		Log();
		void WriteToCOut(LogLevels p_LogLevel, std::string p_String);
		void WriteToLogFile(LogLevels p_LogLevel, std::string p_String);

	public:
		void Write(LogLevels p_LogLevels, std::string p_String);
		LogFileWriter& GetLogFile();
		void SetWriteToCOut(bool p_WriteToCOut);
		void SetWriteToLogFile(bool p_WriteToLogFile);
	};

}
